using System;


namespace OhioState.Graphics
{
    /// <summary>
    /// what kind of color
    /// </summary>
    public enum ColorKind
    {
        /// <summary>
        /// Front ambient color
        /// </summary>
        FRONT_AMBIENT,
        /// <summary>
        /// Front Diffuse color
        /// </summary>
        FRONT_DIFFUSE,
        /// <summary>
        /// Front Specular color
        /// </summary>
        FRONT_SPECULAR,
        /// <summary>
        /// Front emissive color
        /// </summary>
        FRONT_EMISSIVE,
        /// <summary>
        /// Back ambient color
        /// </summary>
        BACK_AMBIENT,
        /// <summary>
        /// Back diffuse color
        /// </summary>
        BACK_DIFFUSE,
        /// <summary>
        /// Back specular color
        /// </summary>
        BACK_SPECULAR,
        /// <summary>
        /// Back emissive color
        /// </summary>
        BACK_EMISSIVE,
        /// <summary>
        /// Current color
        /// </summary>
        CURRENT
    }
    /// <summary>
    /// Material Color class that holds the different color values
    /// </summary>
    [Serializable()]
    public class MaterialColors : ICloneable
    {
        #region Public Properties
        private OSUColor _ambientColor;
        /// <summary>
        /// Get/Set Ambient Color
        /// </summary>
        public OSUColor AmbientColor
        {
            get { return _ambientColor; }
            set { _ambientColor = value; }
        }

        private OSUColor _diffuseColor;
        /// <summary>
        /// Get/Set Diffuse Color
        /// </summary>
        public OSUColor DiffuseColor
        {
            get { return _diffuseColor; }
            set { _diffuseColor = value; }
        }
        private OSUColor _specularColor;
        /// <summary>
        /// Get/Set Specular Color
        /// </summary>
        public OSUColor SpecularColor
        {
            get { return _specularColor; }
            set { _specularColor = value; }
        }
        private int _specularExponent;
        /// <summary>
        /// Get/Set Specular Exponent
        /// </summary>
        public int SpecularExponent
        {
            get { return _specularExponent; }
            set { _specularExponent = value; }
        }
        private OSUColor _emissiveColor;
        /// <summary>
        /// Get/Set Emissive Color
        /// </summary>
        public OSUColor EmissiveColor
        {
            get { return _emissiveColor; }
            set { _emissiveColor = value; }
        }
        #endregion Public Properties

        /// <summary>
        /// Create a new MaterialColors object with all color components
        /// white and specular exponent equal to 100.
        /// </summary>
        public MaterialColors()
        {
            _ambientColor = new OSUColor(OSUColor.Black);
            _diffuseColor = new OSUColor(OSUColor.White);
            _specularColor = new OSUColor(OSUColor.Black);
            _specularExponent = 100;
            _emissiveColor = new OSUColor(OSUColor.Black);
        }

        /// <summary>
        /// Create a new MaterialColors object from a given
        /// MaterialColors object.
        /// </summary>
        /// <param name="copyTarget">The objects to copy parameters from.</param>
        public MaterialColors(MaterialColors copyTarget)
        {
            _ambientColor = new OSUColor(copyTarget.AmbientColor);
            _diffuseColor = new OSUColor(copyTarget.DiffuseColor);
            _specularColor = new OSUColor(copyTarget.SpecularColor);
            _specularExponent = copyTarget.SpecularExponent;
            _emissiveColor = new OSUColor(copyTarget.EmissiveColor);
        }
        /// <summary>
        /// Overrides shared object ToString method
        /// </summary>
        /// <returns>A string representing the various colors</returns>
        public override string ToString()
        {
            return "Ambient color: " + _ambientColor.ToString()
                + " Diffuse color: " + _diffuseColor.ToString()
                + " Specular color: " + _specularColor.ToString()
                + " Specular exponent: " + _specularExponent.ToString()
                + " Emissive color: " + _emissiveColor.ToString();
        }
        /// <summary>
        /// Clone a MaterialColor object
        /// </summary>
        /// <returns>cloned object</returns>
        public Object Clone()
        {
            MaterialColors clone = new MaterialColors(this);
            return clone;
        }
    }
}